package com.cloud.code.lombok;

import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class User {

    private String iPhone;

    private String userName;
}


class Test{
    public static void main(String[] args) {

        User user = new User("1779293882","xiaohua");


        System.out.println(JSON.toJSONString(user));

        String text = "{\"iPhone\":\"1779293882\",\"userName\":\"xiaohua\"}";
        User user1 = JSON.parseObject(text, User.class);

        System.out.println(user1);

    }
}
